<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                template="/templates/template.xhtml">
    <ui:define name="title">旧后台合作方当天扣量系数修改</ui:define>
    <ui:define name="content">
        <h:form>

            <div class="topbar clearfix"
                 style="background: -webkit-linear-gradient(top,#f6f7f9 0,#ebedf0 100%);">
                <p:toolbar>
                    <f:facet name="right">
                        <p:commandButton value="保存" icon="fa fa-save" update="@form"
                                         actionListener="#{collaborateOldManagerRatioBean.save()}"/>
                    </f:facet>
                </p:toolbar>
            </div>

            <div class="ui-fluid" style="padding-top: 30px;">
                <div class="ui-g">
                    <div class="ui-g-12">
                        <div class="card ui-g-12">
                            <div class="ui-g">
                                <div class="ui-g-2">
                                    <p:outputLabel value="合作方渠道"/>
                                </div>
                                <div class="ui-g-2">
                                    <p:selectOneMenu filter="true" filterMatchMode="startsWith"
                                                     value="#{collaborateOldManagerRatioBean.$.id}">
                                        <p:ajax event="change" process="@this" update="tratio"
                                                listener="#{collaborateOldManagerRatioBean.channelChange()}"/>
                                        <f:selectItem itemLabel="请选择" itemValue=""/>

                                        <f:selectItems value="#{collaborateOldManagerRatioBean.channels}"
                                                       var="commProduct"
                                                       itemLabel="#{commProduct.channelName}"
                                                       itemValue="#{commProduct.id}"/>
                                    </p:selectOneMenu>
                                </div>
                            </div>

                            <div class="ui-g">
                                <div class="ui-g-2">
                                    <p:outputLabel value="当天系数配置(即时生效)"/>
                                </div>
                                <div class="ui-g-2">
                                    <p:inputNumber id="tratio" value="#{collaborateOldManagerRatioBean.$.ratio}"
                                                   symbol="%" emptyValue="sign" symbolPosition="s"
                                                   minValue="0" maxValue="100"/>
                                </div>
                                <div class="ui-g-2">
                                    <strong style="color: red">(注意，更改此渠道系数时，所有该渠道的合作方都以此更改为基准)</strong>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </h:form>
    </ui:define>
</ui:composition>
